package com.ld.security.auth.common.sys.api;


import com.ld.security.auth.common.sys.entity.SysUserEntity;
import com.ld.security.auth.common.sys.po.UpdatePasswordPo;
import com.ld.security.auth.common.sys.service.ISysUserService;
import com.ld.security.common.mybatis.base.vo.DataVo;
import com.ld.security.common.tomcat.anno.AjaxLogKey;
import com.ld.security.common.tomcat.base.api.SuperApi;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
@Api(tags="用户Api管理")
@RequestMapping("/api/sysUser")
public class SysUserApi  extends SuperApi<SysUserEntity>{

        @Autowired
        private ISysUserService iSysUserService;

    @AjaxLogKey
        @ApiOperation("修改制定用户密码")
        @RequestMapping(value = "/updatePassowrd",method = RequestMethod.POST)
       public DataVo updatePassowrd(@RequestBody UpdatePasswordPo po){

               int total = iSysUserService.updatePassword(po);
               String msg = total>0?"成功":"失败";
               return DataVo.ofMsg("修改密码"+msg);
       }


        }
